import request from '@/config/axios'

// 风险辨识主 VO
export interface RiskIdentifyVO {
  id: number // 主键id
  riskType: number // 风险类型
  riskTypeInfoId: number // 风险类型内容id
}

// 风险辨识主 API
export const RiskIdentifyApi = {
  // 查询风险辨识主分页
  getRiskIdentifyPage: async (params: any) => {
    return await request.get({ url: `/zjyj/risk-identify/page`, params })
  },
  getRiskIdentifyApplyRecordPage: async (params: any) => {
    return await request.get({ url: `/zjyj/risk-identify/applyRecord/page`, params })
  },

  getRiskIdentifyDetailPage: async (params: any) => {
    return await request.get({ url: `/zjyj/risk-identify/detail/page`, params })
  },

  // 查询风险辨识主详情
  getRiskIdentify: async (id: number) => {
    return await request.get({ url: `/zjyj/risk-identify/get?id=` + id })
  },

  // 新增风险辨识主
  createRiskIdentify: async (data: RiskIdentifyVO) => {
    return await request.post({ url: `/zjyj/risk-identify/create`, data })
  },

  // 修改风险辨识主
  updateRiskIdentify: async (data: RiskIdentifyVO) => {
    return await request.put({ url: `/zjyj/risk-identify/update`, data })
  },

  // 删除风险辨识主
  deleteRiskIdentify: async (id: number) => {
    return await request.delete({ url: `/zjyj/risk-identify/delete?id=` + id })
  },

  // 导出风险辨识主 Excel
  exportRiskIdentify: async (params) => {
    return await request.download({ url: `/zjyj/risk-identify/export-excel`, params })
  },
  applyAssessment: async (id: number) => {
    return await request.get({url: `/zjyj/risk-identify/applyAssessment?id=` + id})
  }
}
